package com.bckj.fastboot.upms.biz.mapper;

import com.bckj.fastboot.upms.api.entity.SysParam;
import com.bckj.fastboot.upms.api.vo.SysParamVO;
import com.bckj.fastboot.upms.api.dto.SysParamQuery;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.jdbc.SQL;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;

/**
 * 系统参数表(SysParam)表数据库访问层
 *
 * @author wfc
 * @since 2023-09-09 10:50:46
 */
@Mapper
public interface SysParamMapper extends BaseMapper<SysParam> {

    /**
      * 列表
      *
      * @param query req
      * @return list
      */
    @SelectProvider(method = "list" , type = SysParamProvider.class)
    List<SysParamVO> list(SysParamQuery query);
    
    class SysParamProvider{
        
        public String list(SysParamQuery query){
            return new SQL(){{
                SELECT("id, type, name, code, value, is_enable, is_system, version, delete_flag, create_id, update_time, create_time");
                FROM("sys_param");
                ORDER_BY("id DESC");
            }}.toString();
        }
    }
}

